home *** CD-ROM | disk | FTP | other *** search
- ''
- '' $Id: GetFilesys.bas,v 1.2 1994/03/16 12:41:49 alex Rel $
- ''
- '' Example of examining the FileSysRes list
- ''
- '' Derived from RKM example (c) Copyright 1992 Commodore-Amiga, Inc.
- ''
-
- DEFINT A-Z
-
- 'REM $INCLUDE Exec.bh
- 'REM $INCLUDE FileSystem.bc
-
- LIBRARY OPEN "exec.library", LIBRARY_MINIMUM&
-
- SUB main
- STATIC FileSysResBase&, fse&, x
-
- ' NOTE - you should actually be in a Forbid while accessing any
- ' system list for which no other method of arbitration is available.
- ' However, for this example we will be printing the information
- ' (which would break a Forbid anyway) so we won't Forbid.
- ' In real life, you should Forbid, copy the information you need,
- ' Permit, then print the info.
-
- FileSysResBase& = OpenResource&(SADD("FileSystem.resource" + CHR$(0)))
- IF FileSysResBase& = NULL& THEN
- PRINT "Cannot open FileSystem.resource"
- ELSE
- fse& = PEEKL(PEEKL(FileSysResBase& + fsr_FileSysEntries) + lh_Head)
- IF fse& <> NULL& THEN
- DO
- IF PEEKL(fse& + fse_Node + ln_Name) <> NULL&
- PRINT "Found filesystem creator: "; PEEK$(PEEKL(fse& + fse_Node + ln_Name))
- END IF
- PRINT " DosType: ";
- FOR x = 0 TO 2
- PRINT CHR$(PEEKB(fse& + fse_DosType + x));
- NEXT x
- PRINT CHR$(PEEKB(fse& + fse_DosType + 3) + &h30);
- PRINT
- PRINT " Version: ";
- PRINT PEEKW(fse& + fse_Version); "."; PEEKW(fse& + fse_Version + 2);
- PRINT
- PRINT
-
- fse& = PEEKL(fse& + fse_Node + ln_Succ)
- LOOP WHILE PEEKL(fse& + fse_Node + ln_Succ)
- END IF
- END IF
- END SUB
-
- main
- END
-